#include "server.hpp"
using namespace std;
int main()
{
    Socket se;
    bool ret=se.CreateServer(8500);
    while (1) 
    {
        int newfd = se.Accept();
        if (newfd < 0) continue;
        
        Socket cli_sock(newfd);
        char buf[1024] = {0};
        int ret = cli_sock.Recv(buf,1023);
        if(ret < 0) 
           cli_sock.Close();
        cli_sock.Send(buf,ret);
        cli_sock.Close();
    }
    se.Close();

    return 0;
}